﻿using Cxuu.Common;
using Cxuu.Models;
using Cxuu.Repository;
using Microsoft.Extensions.DependencyInjection;
using PetaPoco;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Cxuu.Service
{
    [UseDI(ServiceLifetime.Scoped)]
    public class AttmentService
    {
        private readonly AttmentRepository _attment;
        public AttmentService(AttmentRepository attmentRepository)
        {
            _attment = attmentRepository;
        }

        public async Task<Page<ViewAttment>> GetPageListAsync(int page, int limit, int uid)
        {
            return await _attment.GetPageListAsync(page, limit, uid);
        }

        public async Task<List<ViewAttment>> GetListAsync(string id)
        {
            return await _attment.GetListAsync(id);
        }

        public virtual async Task<object> InsertAsync(Attment attment)
        {
            return await _attment.InsertAsync(attment);
        }

        public async Task<Attment> GetAsync(int? id)
        {
            return await _attment.GetAsync(id);
        }


        public async Task<int> DeleteByPriKeyAsync(int id)
        {
            return await _attment.DeleteByPriKeyAsync(id);
        }


    }
}
